package com.szzg10.thinking.chapter18;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;

public class FileOutputShortcut {

	public static void main(String[] args) throws IOException {
		File file = new File(BufferedInputFile.FILE_NAME);
		FileReader fileReader = new FileReader(file);
		BufferedReader bufferedReader = new BufferedReader(fileReader);
		
		PrintWriter printWriter = new PrintWriter(BasicFileOutput.FILE_NAME_OUT);
		
		int count = 1;
		String str;
		while((str = bufferedReader.readLine()) != null) {
			printWriter.println(count + ": " + str);
			count++;
		}
		
		bufferedReader.close();
		printWriter.close();
	}
}
